let message: 'hello' = 'hello'
// Type 123 is not assignable to type "hello"
// message = 123

type Alignment = 'left' | 'right' | 'bottom' | 'top'
function changeAlign(align: Alignment) {
  console.log(align)
}
changeAlign('left')

type MethodType = 'post' | 'get'
function request(url: string, method: MethodType) {}

// TS细节
const info = {
  url: 'xxx',
  method: 'post'
}
request(info.url, info.method as MethodType)

// 指定info1为字面量类型
const info1 = {
  url: 'xxx',
  method: 'post'
} as const

request(info1.url, info1.method)


export {}